//
//  DockController.m
//  测试Dock
//
//  Created by apple on 13-10-27.
//  Copyright (c) 2013年 itcast. All rights reserved.
//

#import "DockController.h"
#import "Dock.h"

#define kDockHeight 44

@interface DockController ()  <DockDelegate>
@end

@implementation DockController

-(id)init {
    if (self = [super init]) {
        [self initDock];
    }
    return self;
}

-(id)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        [self initDock];
    }
    return self;
}

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        [self initDock];
    }
    return self;
}

- (void)initDock {
    Dock *dock = [[Dock alloc] init];
    dock.delegate = self;
    _dock = dock;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self addDock];
}



#pragma mark 添加Dock
- (void)addDock
{

    //[self.tabBar removeFromSuperview];
    
 
   // _dock.frame = self.tabBar.frame;

   // [self.view addSubview:_dock];
    
    _dock.frame = (CGRect){CGPointZero,self.tabBar.frame.size};
    [self.tabBar addSubview:_dock];
}



-(void)dock:(Dock *)dock didSelectIndexFrom:(NSInteger)from to:(NSInteger)to {
    self.selectedIndex = to;
}


@end
